﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;

namespace zielonka.co.uk.extensions.system.io
{
    // Description:	Filters out directories that are hidden
    /*
        var files = new DirectoryInfo(@"\\myserver\C$").GetDirectories().Where(x => x.IsNotHidden()).Select(x => x.Name).ToArray();
     */

    public static partial class DirectoryInfoExtensions
    {
        public static bool IsNotHidden(this DirectoryInfo directoryInfo)
        {
            return (directoryInfo.Attributes & FileAttributes.Hidden) == 0;
        }
    }
}
